import com.lzq.mybatis.entity.User;
import com.lzq.mybatis.mapper.userMapper;
import com.lzq.mybatis.session.sqlSession;
import com.lzq.mybatis.session.sqlSessionFactory;
import org.junit.Test;

import java.util.List;

public class test {
    @Test
    public void test(){
        sqlSessionFactory factory = new sqlSessionFactory();
        sqlSession session = factory.openSession();
        System.out.println(session.toString());
        //通过动态代理实现面向接口的编程模式
        //
       userMapper mapper = session.getMapper(userMapper.class);
        /*User user = mapper.selectById("2");
        System.out.println(user);*/
        //session.selectList("com.lzq.mybatis.mapper.userMapper.selectAll",null);
       List<User> selectAll = mapper.selectAll();
        for(User saleVisit : selectAll){
            System.out.println(saleVisit.toString());
        }
    }
}
